package cn.i96688.scanclient.ui;

import java.awt.Component;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.concurrent.atomic.AtomicInteger;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class SuperPane extends JPanel implements ActionListener,MouseListener{

	private static final long serialVersionUID = -8148290238626945031L;
	
	private int index;
	private static AtomicInteger ATOMIC_INDEX=new AtomicInteger();
	@Override
	public void mouseClicked(MouseEvent e) {
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		
	}
	
	public boolean check(){
		return true;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	
	public int getAndIncrementIndex(){
		index=ATOMIC_INDEX.getAndIncrement();
		return index;
	}
	
	public int getSelectRow(){
		return 0;
	}
	
	protected JFrame getFrame(Component comp){
		Container c=comp.getParent();
		if(c==null)
			return null;
		if(c instanceof JFrame)
			return (JFrame)c;
		return getFrame(c);
	}
}
